import request from '@/utils/request'

export const getCaptcha = () => {
    return request.get("/user/captcha/generate")
}

export const login = (loginForm) => {
    return request.post('/user/login/password',JSON.stringify(loginForm))
}

export const getRegisterMessageCaptcha = (form) => {
    return request.post('/user/verificationcode/send/register',null,{
        params: form
    })
}

export const register = (form) => {
    return request.post('/user/register',form)
}

export const getLoginMessageCaptcha = (form) => {
    return request.post('/user/verificationcode/send/login',null,{
        params: form
    })
}

export const loginBySms = (form) => {
    return request.post('/user/login/phonecode',form)
}

export const check = (form) => {
    return request.post('/user/verificationcode/verify',null,{
        params: form
    })
}

export const getUserInfo = () => {
    return request.get('/user/token')
}

export const userSelectPhone = (phone) => {
    return request.get('/user/select/' + phone)
}

export const userStorage = () => {
    return request.get('/user/storage')
}

export const userStatistic = () => {
    return request.get('/user/statistic')
}

export const selectUserById = (userid) => {
    return request.get('/user/' + userid)
}